from applications.common.utils.spider_utils.crawl_cwzx import Crawl_cwzx
from flask import current_app
from celery import shared_task

from applications.common.utils.spider_utils.crawl_xueqiu_index_eva import Crawl_Index_Eva


@shared_task(ignore_result=False)
def crawl_cwzx_task():
    current_app.logger.info("crawl_cwzx_task start")
    Crawl_cwzx().run()
    current_app.logger.info("crawl_cwzx_task end")


@shared_task(ignore_result=False)
def crawl_xueqiu_index_eva():
    '''
        爬取雪球指数估值
    '''
    current_app.logger.info("crawl_xueqiu_index_eva start")
    Crawl_Index_Eva().run()
    current_app.logger.info("crawl_xueqiu_index_eva end")
